#include "stdafx.h"
#include "terrain.h"
#include "myRand.h"

int terrain[kMaxRows][kMaxCols];

void initTerrain()
{
	int i,j;
	for(i=0; i<kMaxRows; i++)
		for(j=0; j<kMaxCols; j++)
			terrain[i][j] = kGround;

	for(i=0; i<kMaxWater; i++)
		terrain[rnd(0,kMaxRows-1)][rnd(0, kMaxCols-1)] = kWater;
	for(i=0; i<kMaxPoison; i++)
		terrain[rnd(0,kMaxRows-1)][rnd(0, kMaxCols-1)] = kPoison;
	for(i=0; i<kMaxFood; i++)
		terrain[rnd(0,kMaxRows-1)][rnd(0, kMaxCols-1)] = kFood;

	terrain[kRedHomeRow][kRedHomeCol] = kRedHome;
	terrain[kBlackHomeRow][kBlackHomeCol] = kBlackHome;
}
